﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KLY.DataModels;
using KLY.Tools;

namespace KLY.ServiceCore
{
    public class LoginAccount : ServiceBase<LoginRequest, LoginResponse>
    {
        public LoginAccount(LoginRequest request)
        {
            this._request = request;
        }
        public override LoginResponse Process()
        {
            base.Url = string.Format("http://{0}/v1/api/101004/",BizCommon.Domain);
            base.Method = HttpMethod.POST;
            base.ListHead = new List<RequestHead>
                {
                    new RequestHead
                    {
                        HeaderName="version",
                        HeaderValue="1.0.0"
                    }
                };
            this._request.Platform = "003";
            base.Request = this._request;
            var response = base.Process();
            if(response == null)
            {
                return new LoginResponse
                {
                    Ok = false,
                    Message = "登录失败请稍后再试"
                };
            }
            return response;
        }

        private LoginRequest _request;
    }
}
